import random


def pan(a, b):
    if (a == 'stone' and a == 'scissor') or (a == 'scissor' and b == 'paper') or (a == 'paper' and b == 'stone'):
        return True
    else:
        return False


def main():
    sum1 = 0
    sum2 = 0
    i = 1
    print("石头剪刀布，三局两胜，请输入你的选择，stone-石头，paper-布，scissor-剪刀")
    while i:

        a = random.randint(0, 2)
        if a == 0:
            cc = 'stone'
        elif a == 1:
            cc = 'paper'
        else:
            cc = 'scissor'
        uc = input()
        while uc != 'stone' and uc != 'scissor' and uc != 'paper':
            print("输入不正确，请重新输入")
            uc = input()
        if uc == cc:
            print("第", i, "是平局，", cc, "对", uc)
            i += 1
            continue
        if pan(cc, uc):
            sum1 += 1
            print("第", i, "局计算机胜利，", "计算机选择", cc, "对", "玩家选择", uc)
        else:
            sum2 += 1
            print("第", i, "局玩家胜利，", "玩家选择", uc, "对", "计算机选择", cc)
        if sum1 >= 2:
            print("\n最终结果是计算机胜利，比分是", sum1, "比", sum2)
            break
        if sum2 >= 2:
            print("\n最终结果是玩家胜利，比分是", sum2, "比", sum1)
            break
        i += 1


main()
